﻿var iframeYukseklik = 53;
var version =dovizEklenti.ver;
function addTpl(dovizEklenti){
    var kurlar = dovizEklenti.kurlar.split("-");
    var kurlarSayisi = kurlar.length;
    var kurTpl = "";
    
    for (var i = 0; i < kurlarSayisi; i++) {
        kurTpl += '<div id="' + kurlar[i] + '" class="kur wrap mt5"> <div class="wrap"> <h1><a class="sidebar-link ' + kurlar[i] + '" >' + kurlar[i] + '</a></h1> <div class="icon wrap">&nbsp;</div> </div> <div class="wrap mt5"> <span class="aswrap"><span class="as">Alış :</span><span class="unit alis">0.000 TL</span></span> <span class="aswrap"><span class="as">Satış :</span><span class="unit satis">0.000 TL</span></span> </div> </div>';
       iframeYukseklik = (parseInt(iframeYukseklik)+83);
	};	
    return kurTpl
}

if (dovizEklenti.bankalar == 'acik') 
    var bankalar = "<div class='combo'> <a class='source-selector wrap' href='javascript:;'> <span class='up' style='display:none;' > &nbsp;</span> <span class='down'>&nbsp;</span> <span class='source-selector-text'>Serbest Piyasa</span></a> <ul class='sources' style='display:none'> <li><a id='serbest-piyasa' href='javascript:;'>Serbest Piyasa</a> </li> <li><a id='merkez-bankasi' href='javascript:;'>Merkez Bankası</a> </li> <li><a id='akbank' href='javascript:;'>Akbank</a> </li> <li><a id='garanti' href='javascript:;'>Garanti Bankası</a> </li> <li><a id='ziraat' href='javascript:;'>Ziraat</a> </li> <li><a id='isbankasi' href='javascript:;'>İş Bankasi</a> </li> <li><a id='yapikredi' href='javascript:;'>Yapikredi</a> </li> <li><a id='finansbank' href='javascript:;'>Finansbank</a> </li> <li><a id='sekerbank' href='javascript:;'>Şekerbank</a> </li> <li><a id='halkbank' href='javascript:;'>Halkbank</a> </li> <li><a id='denizbank' href='javascript:;'>Denizbank</a> </li> <li><a id='vakifbank' href='javascript:;'>Vakifbank</a> </li>         </ul> </div>";
else 
    var bankalar = "";
var mydomain=document.domain;	
var analytic = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0" width="1" height="1" id="dovizeklenti" align="middle"> <param name="allowScriptAccess" value="always" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://static.doviz.com/flash/gTracker.swf?v1" /> <param name="quality" value="best" /> <param name="bgcolor" value="#000000" /> <param name="flashvars" value="url='+mydomain+'&type=dovizwidget'+version+'" /><param name="wmode" value="transparent" /> <param name="scale" value="noscale" /> <param name="salign" value="tl" />  <embed src="http://static.doviz.com/flash/gTracker.swf" value="url='+mydomain+'&type=doviz" wmode="transparent" bgcolor="#000000" allowscriptaccess="always" name="dovizeklenti"  allowfullscreen="true" scale="noScale" quality="best" salign="tl" width="1" height="1" type="application/x-shockwave-flash"></embed> </object> ';
var kurlar = addTpl(dovizEklenti);
//if(document.getElementById("dovizcom"))
//	document.getElementById("dovizcom").style.display='none';
//	else alert('LÃ¼tfen DÃ¶viz.com eklenti koduna aÅŸaÄŸıdaki linki ekleyiniz.\n <a id="dovizcom" target="_blank" href="http://www.doviz.com">DÃ¶viz</a>')
var html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><link href='http://static.doviz.com/css/eklenti.css' rel='stylesheet' type='text/css' /><style type='text/css'>.conwrap {background:" + dovizEklenti.arkaPlan + ";width:"+dovizEklenti.genislik+"px} .kur {background:" + dovizEklenti.kutu + "} span.source-selector-text {color:" + dovizEklenti.bankaAdi + " } span.as {color:" + dovizEklenti.alisSatis + "} a.sidebar-link {color:" + dovizEklenti.kurAdi + "} span.unit {color:" + dovizEklenti.kurDegeri + "}</style><script type='text/javascript' src='http://static.doviz.com/js/eklenti-kontrol.js'></script></head><body><div class='all'> <div class='conwrap'>"+ bankalar +" <div id='content'>" + kurlar + " </div> </div></div>"+analytic+"</body></html>";
document.write("<iframe id='dovizEklentiFrame' scrolling='no' frameborder='0' allowtransparency='yes' style='width:" + (parseInt(dovizEklenti.genislik)+9) + "px; height:" + iframeYukseklik + "px;'></iframe>");
var iframe = document.getElementById('dovizEklentiFrame');
iframe = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument;
iframe.document.open();
iframe.document.charset = "UTF-8";
iframe.document.write(html);
iframe.document.close();